#include<iostream>
using namespace std;
#include <string>
//1，定义结构体
struct Student
{


    //姓名
    string name;
    //年龄
    int age;
    //分数
    int score;
};





int main()
{
    //2,创建结构体数组
    struct Student stuArray[3] =
            {
                    {"张宁",18,100},
                    {"李宁",28,30},
                    {"王宁",38,40},
            };


    //3，结构体数组中的元素赋值
    stuArray[2].name = "赵丽";
    stuArray[2].age = 80;
    stuArray[2].score = 22;


    //遍历结构体数组
    for (int i = 0; i < 3; ++i) {
        cout<<"姓名："<<stuArray[i].name
        <<"年龄"<<stuArray[i].age
        <<"分数"<<stuArray[i].score<<endl;
    }
    system("pause");
    return 0;

}